package com.ganmiao.server.supplier.service;

import com.ganmiao.server.supplier.entity.Tender;
import com.ganmiao.server.supplier.mapper.TenderMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class TenderService {

    @Autowired
    private TenderMapper tendersMapper;
    public Tender tendersGet(Integer id) {
        Tender tenders = tendersMapper.tendersGet(id);
        return tenders;
    }

    public List<Tender> getAllTenders() {
        return tendersMapper.getAllTenders();
    }

    public Integer tenderCreate(Tender tenders) {
        int rowsAffected = tendersMapper.tenderCreate(tenders);
        return rowsAffected;
    }

    public void tendersUpdate(Integer id, Tender tenders) {
        tendersMapper.tendersUpdate(id, tenders.getLabel(), tenders.getName(), tenders.getTime(), tenders.getEndTime(), tenders.getContent(), tenders.getPayMoney(), tenders.getTender_Status());
    }

    public void tendersDelete(Integer id) {
        tendersMapper.tendersDelete(id);
    }

}
